<?php

	class Click_log_model extends CI_Model {

		protected $__tbname = 'click_log';
		protected $__dbconf = 'default';

		var $id;	//bigint(20) unsigned	Primary Key	Auto Increment	NOT NULL
		var $id_campaign;	//bigint(20) unsigned			NOT NULL
		var $id_user;	//bigint(20) unsigned			NOT NULL
		var $ip;	//varchar(20)			NOT NULL
		var $location;	//varchar(2)			NOT NULL
		var $date;	//datetime			NOT NULL

		protected $__validation_rule = array(
			'id' => array('key' => 'PRI', 'type' => 'bigint', 'null' => FALSE, 'auto_increment' => TRUE),
			'id_campaign' => array('key' => 'MUL', 'type' => 'bigint', 'null' => FALSE),
			'id_user' => array('type' => 'bigint', 'null' => FALSE),
			'ip' => array('type' => 'varchar', 'size' => 20, 'null' => FALSE),
			'location' => array('type' => 'varchar', 'size' => 2, 'null' => FALSE),
			'date' => array('type' => 'datetime', 'null' => FALSE)
		);

		protected $__relation = array(
			array('table' => 'campaign', 'foreign_key' => 'id_campaign'),
			array('table' => 'user', 'foreign_key' => 'id_user')
		);
	}
